package com.boss;

/**
 * @ClassName Singleton
 * @Description
 * @Author xinggh
 * @Date 2020/8/14 15:16
 * @Version 1.0
 **/
public class Singleton {

    private static volatile Singleton instance;

    private Singleton() {

    }

    public static Singleton getInstance() {
        if (instance == null) {
            synchronized (Singleton.class) {
                if (instance == null) {
                    instance = new Singleton();
                }
            }
        }
        return instance;
    }
}
